home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.10 / medplayerlibrary / medplayer.i < prev    next >
Text File  |  1995-04-19  |  4KB  |  158 lines

  1. {
  2.    ------------------------------------------------------------------
  3.  
  4.    med.player.i 4 use with PCQ-Pascal, (P) 1993 by "Diesel" B. Künnen
  5.  
  6.  
  7.  
  8.    Zum Linken zusätzlich die medplayer.library verwenden :   { !!! }
  9.  
  10.    blink mySrc.o to mySrc library pcq:pcq.lib pcq:diesel.lib ND SD SC
  11.  
  12.    ------------------------------------------------------------------
  13. }
  14.  
  15. Type
  16.  
  17. MMD0 = RECORD
  18.     ID,                { "MMD0" }
  19.     Modlen       : Integer;        { module length (in bytes) }
  20.     MMD0song     : Address;        { pointer to song (see med.h) }
  21.     Songlen      : Integer;        { length of song (usually zero) }
  22.     MMD0block    : Address;        { pointer to pointers of blocks }
  23.     BlockArrlen  : Integer;        { length... }
  24.     Soitin       : Address;        { pointer to pointers of samples }
  25.     SmplArrlen   : Integer;        { len.. }
  26.     MMD0exp      : Address;        { pointer to expansion data (see med.h) }
  27.     ExpSize      : Integer;        { len.. (don't care about these) }
  28.  
  29. { Followed by some private variables that have become obsolete in V3.00... }
  30. End;
  31. MMD0Ptr    = ^MMD0;
  32.  
  33.  
  34.  
  35. InstrExt = Record    { THIS STRUCT MAY GROW IN THE FUTURE!! }
  36.     hold,        { to get the correct size, examine s_ext_entrsz }
  37.     decay  : Byte;
  38. End;
  39. InstrExtPtr = ^InstrExt;
  40.  
  41.  
  42.  
  43. MMD0exp = Record
  44.     reserved    : Integer;    { for future... }
  45.     InstrExt    : Address;
  46.     s_ext_entries,            { # of entries }
  47.     s_ext_entrsz    : Short;    { size of entry}
  48.     annotxt        : Address;    { song name, ©, notes etc... }
  49.     annolen        : Integer;    { length (including 0-byte) }
  50.     reserved2    : Array[1..16] of Integer; { better have enough of these... }
  51. End;
  52. MMD0expPtr = ^MMD0exp;
  53.  
  54.  
  55.  
  56. MMD0sample = Record
  57.     rep,replen    : Short;    { offs: 0(s), 2(s) }
  58.     midich,                { offs: 4(s) }
  59.     midipreset,            { offs: 5(s) }
  60.     svol,                { offs: 6(s) }
  61.     strans        : Byte;        { offs: 7(s) }
  62. End;
  63. MMD0samplePtr = ^MMD0sample;
  64.  
  65.  
  66.  
  67.  
  68. MMD0song = Record
  69.     MMD0sample    : Array[1..63] of MMD0Sample;
  70.                         { 63 * 8 bytes = 504 bytes }
  71.     numblocks,                { offs: 504 }
  72.     songlen        : Short;        { offs: 506 }
  73.     playseq        : Array[1..256] of Byte;{ offs: 508 }
  74.     deftempo    : Short;        { offs: 764 }
  75.     playtransp,                { offs: 766 }
  76.     flags,                    { offs: 767 }
  77.     reserved,                { offs: 768 }
  78.     tempo2        : Byte;            { offs: 769 }
  79.     trkvol        : Array[1..16] of Byte;    { offs: 770 }
  80.     mastervol,                { offs: 786 }
  81.     numsamples    : Byte;            { offs: 787 }
  82. End;
  83. MMD0SongPtr = ^MMD0Song;        { length = 788 bytes }
  84.  
  85.  { FLAGS of the above structure }
  86.  
  87. Const
  88.  
  89.     FLAG_FILTERON    = $0001;    { hardware low-pass filter }
  90.     FLAG_JUMPINGON    = $0002;    { jumping.. (not used in modules) }
  91.     FLAG_JUMP8TH    = $0004;    { jump 8th..  "    "    " }
  92.     FLAG_INSTRSATT    = $0008;    { instruments are attached (sng+samples) }
  93.     FLAG_VOLHEX    = $0010;    { volumes are represented as hex }
  94.     FLAG_STSLIDE    = $0020;    { no effects on 1st timing pulse (STS) }
  95.     FLAG_8CHANNEL    = $0040;    { OctaMED 8 channel song }
  96.  
  97.  
  98. { -- Const f. GetPlayer() -- }
  99.     NoMidi    = 0;
  100.     Midi    = 1;
  101.  
  102. { -- name of the library, 4 opening it -- }
  103.  
  104.     medname = "medplayer.library";
  105.  
  106. VAR
  107.     MEDPlayerBase    : Address;    { must be opened before    }
  108.                     { using the library !!! }
  109.  
  110.  
  111.  
  112. { -- Functions & Procedures ... !!!  Have fun with it ! -- }
  113.  
  114. Function GetPlayer( midiORnot : Integer ): Integer;    { 0 = OK ;  <>0 failed }
  115.     External;
  116.  
  117.  
  118. Procedure FreePlayer;
  119.     External;
  120.  
  121.  
  122. Procedure PlayModule( mux : MMD0Ptr );
  123.     External;
  124.  
  125.  
  126. Procedure ContModule( mux : MMD0Ptr );
  127.     External;
  128.  
  129.  
  130. Procedure StopPlayer;
  131.     External;
  132.  
  133.  
  134. Procedure DimOffPlayer( songlines : Integer );
  135.     External;
  136.  
  137.  
  138. Procedure SetTempo( harry : Short );
  139.     External;
  140.  
  141.  
  142. Function LoadModule( song : String ): MMD0Ptr;
  143.     External;
  144.  
  145.  
  146. Procedure UnLoadModule( mux : MMD0Ptr );
  147.     External;
  148.  
  149.  
  150. Function GetCurrentModule : MMD0Ptr;
  151.     External;
  152.  
  153. Procedure ResetMidi;
  154.     External;
  155.  
  156.  
  157.  
  158.